
LIST:
  PUSH(FP);
  MOV(FP, SP);
  PUSH(R1); //SAVE R1
  MOV(R1,FPARG(1)); 
  INCR(R1); //R1=n+1, we will loop in reverse order
  MOV(R0,2); //initialize with NIL
LIST_LOOP:
  CMP(R1,1); //check if done
  JUMP_EQ(END_LOOP);
  PUSH(R0); //pointer to next pair
  PUSH(FPARG(R1)); //pointer to arg
  CALL(MAKE_SOB_PAIR); 
  DROP(2);
  DECR(R1); 
  JUMP(LIST_LOOP);
END_LOOP:
  POP(R1); //restore R1
  POP(FP);
  RETURN;
